﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows;

namespace Gronia.WPF.Controls.Primitives
{
    public class FA : Run
    {
        static FA()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(FA), new FrameworkPropertyMetadata(typeof(FA)));
        }

        internal static char[] FontAwesomeChars = new char[] { '\uf042', '\uf170', '\uf037', '\uf039', '\uf036', '\uf038', '\uf0f9', '\uf13d', '\uf17b', '\uf209', '\uf103', '\uf100', '\uf101', '\uf102', '\uf107', '\uf104', '\uf105', '\uf106', '\uf179', '\uf187', '\uf1fe', '\uf0ab', '\uf0a8', '\uf01a', '\uf190', '\uf18e', '\uf01b', '\uf0a9', '\uf0aa', '\uf063', '\uf060', '\uf061', '\uf062', '\uf047', '\uf0b2', '\uf07e', '\uf07d', '\uf069', '\uf1fa', '\uf1b9', '\uf04a', '\uf05e', '\uf19c', '\uf080', '\uf080', '\uf02a', '\uf0c9', '\uf0fc', '\uf1b4', '\uf1b5', '\uf0f3', '\uf0a2', '\uf1f6', '\uf1f7', '\uf206', '\uf1e5', '\uf1fd', '\uf171', '\uf172', '\uf15a', '\uf032', '\uf0e7', '\uf1e2', '\uf02d', '\uf02e', '\uf097', '\uf0b1', '\uf15a', '\uf188', '\uf1ad', '\uf0f7', '\uf0a1', '\uf140', '\uf207', '\uf1ba', '\uf1ec', '\uf073', '\uf133', '\uf030', '\uf083', '\uf1b9', '\uf0d7', '\uf0d9', '\uf0da', '\uf150', '\uf191', '\uf152', '\uf151', '\uf0d8', '\uf20a', '\uf1f3', '\uf1f2', '\uf1f1', '\uf1f4', '\uf1f5', '\uf1f0', '\uf0a3', '\uf0c1', '\uf127', '\uf00c', '\uf058', '\uf05d', '\uf14a', '\uf046', '\uf13a', '\uf137', '\uf138', '\uf139', '\uf078', '\uf053', '\uf054', '\uf077', '\uf1ae', '\uf111', '\uf10c', '\uf1ce', '\uf1db', '\uf0ea', '\uf017', '\uf00d', '\uf0c2', '\uf0ed', '\uf0ee', '\uf157', '\uf121', '\uf126', '\uf1cb', '\uf0f4', '\uf013', '\uf085', '\uf0db', '\uf075', '\uf0e5', '\uf086', '\uf0e6', '\uf14e', '\uf066', '\uf0c5', '\uf1f9', '\uf09d', '\uf125', '\uf05b', '\uf13c', '\uf1b2', '\uf1b3', '\uf0c4', '\uf0f5', '\uf0e4', '\uf1c0', '\uf03b', '\uf1a5', '\uf108', '\uf1bd', '\uf1a6', '\uf155', '\uf192', '\uf019', '\uf17d', '\uf16b', '\uf1a9', '\uf044', '\uf052', '\uf141', '\uf142', '\uf1d1', '\uf0e0', '\uf003', '\uf199', '\uf12d', '\uf153', '\uf153', '\uf0ec', '\uf12a', '\uf06a', '\uf071', '\uf065', '\uf08e', '\uf14c', '\uf06e', '\uf070', '\uf1fb', '\uf09a', '\uf082', '\uf049', '\uf050', '\uf1ac', '\uf182', '\uf0fb', '\uf15b', '\uf1c6', '\uf1c7', '\uf1c9', '\uf1c3', '\uf1c5', '\uf1c8', '\uf016', '\uf1c1', '\uf1c5', '\uf1c5', '\uf1c4', '\uf1c7', '\uf15c', '\uf0f6', '\uf1c8', '\uf1c2', '\uf1c6', '\uf0c5', '\uf008', '\uf0b0', '\uf06d', '\uf134', '\uf024', '\uf11e', '\uf11d', '\uf0e7', '\uf0c3', '\uf16e', '\uf0c7', '\uf07b', '\uf114', '\uf07c', '\uf115', '\uf031', '\uf04e', '\uf180', '\uf119', '\uf1e3', '\uf11b', '\uf0e3', '\uf154', '\uf1d1', '\uf013', '\uf085', '\uf06b', '\uf1d3', '\uf1d2', '\uf09b', '\uf113', '\uf092', '\uf184', '\uf000', '\uf0ac', '\uf1a0', '\uf0d5', '\uf0d4', '\uf1ee', '\uf19d', '\uf0c0', '\uf0fd', '\uf1d4', '\uf0a7', '\uf0a5', '\uf0a4', '\uf0a6', '\uf0a0', '\uf1dc', '\uf025', '\uf004', '\uf08a', '\uf1da', '\uf015', '\uf0f8', '\uf13b', '\uf20b', '\uf03e', '\uf01c', '\uf03c', '\uf129', '\uf05a', '\uf156', '\uf16d', '\uf19c', '\uf208', '\uf033', '\uf1aa', '\uf157', '\uf1cc', '\uf084', '\uf11c', '\uf159', '\uf1ab', '\uf109', '\uf202', '\uf203', '\uf06c', '\uf0e3', '\uf094', '\uf149', '\uf148', '\uf1cd', '\uf1cd', '\uf1cd', '\uf1cd', '\uf0eb', '\uf201', '\uf0c1', '\uf0e1', '\uf08c', '\uf17c', '\uf03a', '\uf022', '\uf0cb', '\uf0ca', '\uf124', '\uf023', '\uf175', '\uf177', '\uf178', '\uf176', '\uf0d0', '\uf076', '\uf064', '\uf112', '\uf122', '\uf183', '\uf041', '\uf136', '\uf20c', '\uf0fa', '\uf11a', '\uf130', '\uf131', '\uf068', '\uf056', '\uf146', '\uf147', '\uf10b', '\uf10b', '\uf0d6', '\uf186', '\uf19d', '\uf001', '\uf0c9', '\uf1ea', '\uf19b', '\uf03b', '\uf18c', '\uf1fc', '\uf1d8', '\uf1d9', '\uf0c6', '\uf1dd', '\uf0ea', '\uf04c', '\uf1b0', '\uf1ed', '\uf040', '\uf14b', '\uf044', '\uf095', '\uf098', '\uf03e', '\uf03e', '\uf200', '\uf1a7', '\uf1a8', '\uf0d2', '\uf0d3', '\uf072', '\uf04b', '\uf144', '\uf01d', '\uf1e6', '\uf067', '\uf055', '\uf0fe', '\uf196', '\uf011', '\uf02f', '\uf12e', '\uf1d6', '\uf029', '\uf128', '\uf059', '\uf10d', '\uf10e', '\uf1d0', '\uf074', '\uf1d0', '\uf1b8', '\uf1a1', '\uf1a2', '\uf021', '\uf00d', '\uf18b', '\uf0c9', '\uf01e', '\uf112', '\uf122', '\uf079', '\uf157', '\uf018', '\uf135', '\uf0e2', '\uf01e', '\uf158', '\uf09e', '\uf143', '\uf158', '\uf158', '\uf156', '\uf0c7', '\uf0c4', '\uf002', '\uf010', '\uf00e', '\uf1d8', '\uf1d9', '\uf064', '\uf1e0', '\uf1e1', '\uf14d', '\uf045', '\uf20b', '\uf20b', '\uf132', '\uf07a', '\uf090', '\uf08b', '\uf012', '\uf0e8', '\uf17e', '\uf198', '\uf1de', '\uf1e7', '\uf118', '\uf1e3', '\uf0dc', '\uf15d', '\uf15e', '\uf160', '\uf161', '\uf0de', '\uf0dd', '\uf0dd', '\uf162', '\uf163', '\uf0de', '\uf1be', '\uf197', '\uf110', '\uf1b1', '\uf1bc', '\uf0c8', '\uf096', '\uf18d', '\uf16c', '\uf005', '\uf089', '\uf123', '\uf123', '\uf123', '\uf006', '\uf1b6', '\uf1b7', '\uf048', '\uf051', '\uf0f1', '\uf04d', '\uf0cc', '\uf1a4', '\uf1a3', '\uf12c', '\uf0f2', '\uf185', '\uf12b', '\uf1cd', '\uf0ce', '\uf10a', '\uf0e4', '\uf02b', '\uf02c', '\uf0ae', '\uf1ba', '\uf1d5', '\uf120', '\uf034', '\uf035', '\uf00a', '\uf009', '\uf00b', '\uf08d', '\uf165', '\uf088', '\uf087', '\uf164', '\uf145', '\uf00d', '\uf057', '\uf05c', '\uf043', '\uf150', '\uf191', '\uf204', '\uf205', '\uf152', '\uf151', '\uf1f8', '\uf014', '\uf1bb', '\uf181', '\uf091', '\uf0d1', '\uf195', '\uf1e4', '\uf173', '\uf174', '\uf195', '\uf1e8', '\uf099', '\uf081', '\uf0e9', '\uf0cd', '\uf0e2', '\uf19c', '\uf127', '\uf09c', '\uf13e', '\uf0dc', '\uf093', '\uf155', '\uf007', '\uf0f0', '\uf0c0', '\uf03d', '\uf194', '\uf1ca', '\uf189', '\uf027', '\uf026', '\uf028', '\uf071', '\uf1d7', '\uf18a', '\uf1d7', '\uf193', '\uf1eb', '\uf17a', '\uf159', '\uf19a', '\uf0ad', '\uf168', '\uf169', '\uf19e', '\uf1e9', '\uf157', '\uf167', '\uf16a', '\uf166' };

        public static readonly DependencyProperty FaProperty = DependencyProperty.Register("Fa", typeof(FontAwesome), typeof(FA), new PropertyMetadata(new PropertyChangedCallback(FaValueChanged)));

        public FontAwesome Fa
        {
            get { return (FontAwesome)GetValue(FaProperty); }
            set { SetValue(FaProperty, value); }
        }

        private static void FaValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            FA fa = (FA)sender;
            int ff = (int)fa.Fa;
            fa.Text = FontAwesomeChars[ff].ToString();
        }
    }
}